import React, { Component } from 'react';
import {
    View,StyleSheet
} from 'react-native';
import { Container, Content, Footer,Button,Text} from 'native-base';
import TabBar from '../../common/tabbar';
import ScrollableTabView from 'react-native-scrollable-tab-view';
import Purchase from '../checklist/purchase';
//未检车次列表
import  CheckList from '../checklist/checklist';
export default class Index extends Component {
    // 构造
    constructor(props) {
        super(props);
        // 初始状态
        this.state = {
            user: null,
            pwd:null,
            tabNames: ['未检', '扫描', '我的'],
            tabIconNames: ['ios-paper', 'ios-albums',   'ios-person'],
        }

        this._LoginClick = this.LoginClick.bind(this);
    }
    componentDidMount() {
        //这里获取从login传递过来的参数:
        this.setState({
            user: this.props.user,
            pwd:this.props.pwd
        });
    }

    render() {
        let tabNames = this.state.tabNames;
        let tabIconNames = this.state.tabIconNames;
        return (


                    <ScrollableTabView
                        renderTabBar={() => <TabBar tabNames={tabNames} tabIconNames={tabIconNames}/>}
                        tabBarPosition='bottom'>

                        <CheckList/>

                        <Purchase tabLabel='purchase'/>

                        <View style={styles.content} tabLabel='key3'>
                            <Text>#3</Text>
                        </View>


                    </ScrollableTabView>



        );
    }
    LoginClick(event){
        alert(this.state.user);
    }

}
const styles = StyleSheet.create({
    content: {

        backgroundColor: '#EBEBEB',
        flex: 1
    }
});
